Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Unclosed ‘[’

Description

The closing square bracket is missing.

It might be missing, as in the first example; it might also be inside a string, as in the second example: the double quote is not closed, which includes the closing square bracket, and makes it missing.

Example

<?php

// This should be at the end of a code, without ; not ?>
$a[$b[3] 

$a["3] = 4;

?>

Alternatives

  • Check that the square brackets are balanced.
  • Check that the closing square brackets are not hidden in a string.